﻿using AMAP.Areas.Supplier.Models.Delivery;
using AMAP.ServiceInterfaces;
using System;
using System.Web.Mvc;

namespace AMAP.Areas.Supplier.Controllers
{
    public class DeliveryController : Controller
    {
        private IRequestService RequestService;

        public DeliveryController(IRequestService RequestService)
        {
            this.RequestService = RequestService;
        }

        //
        // GET: /Supplier/Delivery/
        [Authorize(Roles = "Supplier")]
        public ActionResult Index()
        {
            SupplierDeliveryIndexViewModel Model = new SupplierDeliveryIndexViewModel();
            Model.Requests = this.RequestService.GetRequestFrom(DateTime.Now.AddDays(-7));
            return View(Model);
        }

    }
}
